<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function makeClosures(arr, fn) {
      let list = []
      for (let i = 0; i < arr.length; i++) {
        list[i] = function () {
          return fn(arr[i])
        }
      }
      return list
    }


    console.log(makeClosures([1, 2, 3], function (x) {
      return x * x;
    })[1]());
  </script>
</body>

</html>